<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript">
	/*
	 innerText和textContent的区别,当文本为空时,innerText返回"",而textContent返回undefined
	*/
	window.onload = function() {
		var p1 = document.querySelector("#p1");
		console.log("innerText : " + p1.innerText);
		console.log("textContent : "+p1.textContent);
		
		//修改元素内容
		p1.textContent = "你改变了我";
		
		console.log("innerHTML : " + p1.innerHTML);
	}
</script>
</head>
<body>
	<div id="div1">
		<p id="p1">我是第一个P</p>
		<p id="p2">
			我是第<b>二</b>个P
		</p>
	</div>
</body>
</html>